﻿<UserControl 
  x:Class="Infragistics.Composite.Wpf.Samples.ClockModule.ClockView"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:inf="clr-namespace:Infragistics.Composite.Wpf.Samples.Infrastructure;assembly=Infragistics.Composite.Wpf.Samples.Infrastructure"
  xmlns:ncal="http://infragistics.com/ncal"
  xmlns:res="clr-namespace:Infragistics.Composite.Wpf.Samples.ClockModule.Properties" 

  ncal:XamDockManagerSettings.SplitPaneName="{x:Static inf:SplitPanes.LeftSidePaneName}"
  ncal:XamDockManagerSettings.SplitPaneProxyStyle="{Binding Source={x:Static inf:SplitPanes.Styles}, Path=LeftSidePane}"
  ncal:XamDockManagerSettings.IsContentPaneInTabGroup="True"
  >
  <ncal:XamDockManagerSettings.ContentPaneProxyStyle>
    <Style TargetType="{x:Type ncal:ContentPaneProxy}">
      <Style.Resources>
        <SolidColorBrush x:Key="BackBrush" Color="WhiteSmoke" />
      </Style.Resources>
      <Setter Property="Background" Value="{StaticResource BackBrush}" />
      <Setter Property="Header" Value="{x:Static res:Strings.ClockView_ContentPane_Header}" />
      <Setter Property="Image" Value="clock_odd.png" />
      
      <EventSetter Event="Closed" Handler="OnContentPaneProxyClosed" />
      
      <Style.Triggers>
        <!-- 
        These DataTriggers work properly because the DataContext of a 
        ContentPaneProxy is the actual ContentPane shown in the user interface.
        -->
        <DataTrigger Binding="{Binding Path=Content.SecondsAreEven}" Value="True">
          <Setter Property="Image" Value="clock_even.png" />
        </DataTrigger>

        <DataTrigger Binding="{Binding Path=IsMouseOver}" Value="True">
          <Setter Property="Background" Value="LightBlue" />
        </DataTrigger>

        <!-- 
        Triggers (not DataTriggers) that target the ContentPaneProxy will not work properly since the
        proxy element is never displayed in the user interface.  You must use DataTriggers.
        -->
        <!--<Trigger Property="IsMouseOver" Value="True">
          <Setter Property="Background" Value="LightBlue" />
        </Trigger>-->
      </Style.Triggers>      
    </Style>
  </ncal:XamDockManagerSettings.ContentPaneProxyStyle>

  <TextBlock 
    FontSize="16"
    FontWeight="SemiBold"
    HorizontalAlignment="Center" 
    VerticalAlignment="Center"
    >
    <TextBlock Text="{x:Static res:Strings.ClockView_CurrentTimeHeader}" />
    <TextBlock Text="{Binding Path=CurrentTime}" />
  </TextBlock>
</UserControl>